const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
    transpileDependencies: true,

    lintOnSave: false, //关闭语法检查

    //配置代理服务器（方式一）
    /* devServer: {
        proxy: "http://localhost:5000",
    }, */
    //方式二
    devServer: {
        proxy: {
            //请求前缀
            "/atguigu": {
                target: "http://localhost:5000",
                pathRewrite: {
                    "^/atguigu": "",
                },
                // ws: true, //用于支持websocket
                // changeOrigin: true,
            },
            "/demo": {
                target: "http://localhost:5001",
                pathRewrite: {
                    "^/demo": "",
                },
                // ws: true,
                // changeOrigin: true,
            },
            /* "/foo": {
                target: "<other_url>",
            }, */
        },
    },
});
